package com.qiwenshare.ufop.provider.util;

import com.qiniu.storage.Configuration;
import com.qiniu.storage.Region;
import com.qiwenshare.ufop.provider.config.QiniuyunConfig;

public class QiniuyunUtils {

    private QiniuyunUtils() {
        throw new UnsupportedOperationException("Cannot instantiate utility class");
    }
    public static Configuration getCfg(QiniuyunConfig qiniuyunConfig) {

        //  regionId参考: https://developer.qiniu.com/kodo/1671/region-endpoint-fq
        String regionId = qiniuyunConfig.getKodo().getEndpoint();
        Region region = Region.createWithRegionId(regionId);
        return new Configuration(region);
    }
}
